home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-06-19 | 1.5 KB | 81 lines | [TEXT/MPS ] |
- #define SystemSevenOrLater 1
-
- #include <files.h>
- #include <aliases.h>
- #include <packages.h>
- #include <ppctoolbox.h>
- #include <folders.h>
-
- #include "volumeloop.h"
- #include "directoryloop.h"
- #include "finderevents.h"
- #include "getfoldername.h"
-
- #define rootDirID 2
-
- static void mountvolumes()
- {
- for ( uint16 refnum=1; 1; refnum++ )
- {
- ParamBlockRec pb;
- pb.volumeParam.ioVRefNum= refnum;
- OSErr error = PBMountVol(&pb);
- if ( error == nsDrvErr || error == paramErr )
- break;
- }
- }
-
- static void initsystem()
- {
- InitAllPacks();
- InitGraf(&qd.thePort);
- (void)PPCInit();
- }
-
- void main()
- {
- initsystem();
-
- mountvolumes();
-
- Str255 startupfoldername;
- OSErr error = getfoldername( kStartupFolderType, startupfoldername );
- if (error)
- return;
-
- for ( volumeloop vol; vol.unfinished(); vol.next() )
- {
- if (vol.iswrong())
- continue;
-
- FSSpec startupfolder;
- if ( FSMakeFSSpec( vol.refnum(),
- rootDirID,
- (StringPtr)&startupfoldername,
- &startupfolder )
- != noErr )
- continue;
-
- Boolean wasaliased;
- Boolean isfolder;
- if ( ResolveAliasFile( &startupfolder, 1, &isfolder, &wasaliased ) != noErr )
- continue;
- if ( !isfolder )
- continue;
-
- for ( directoryloop entry( startupfolder );
- entry.unfinished();
- entry.next() )
- {
- if ( entry.iswrong() || entry.invisible() )
- continue;
-
- FSSpec item;
- if ( entry.makespec( item ) != noErr )
- continue;
-
- (void)tellfindertoopen(startupfolder,item);
- }
- }
- }
-